package com.rzj.sys_lab_assistant.utils;

import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @program: sys_lab_assistant
 * @description: 时间处理类
 * @author: 作者
 * @create: 2021-06-29 15:56
 */
public class TimeUtils {

    public static Timestamp getTime() {
        Date t = new Date();
        Timestamp ts = new Timestamp(t.getTime());
        return ts;
    }

    public static Date getDate(String str) throws ParseException {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date date = simpleDateFormat.parse(str);
        return date;
    }

}
